Add more documentation for --features=v2021_3
authorColin Walters <walters@verbum.org>
Tue, 3 Aug 2021 19:01:10 +0000 (15:01 -0400)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:57 +0000 (12:53 -0400)
My previous pass was at the default feature level.

rust-bindings/rust/src/functions.rs
rust-bindings/rust/src/kernel_args.rs
rust-bindings/rust/src/repo.rs
rust-bindings/rust/src/repo_checkout_at_options/mod.rs
rust-bindings/rust/src/sysroot_deploy_tree_opts.rs
rust-bindings/rust/src/sysroot_write_deployments_opts.rs

index a30ea7bf0f1fd91f2c87c58f1d6e197ff595bc03..053f0c57cfd7347493d25117677340e38d428389 100644 (file)
@@ -110,6 +110,7 @@ pub fn checksum_file_from_input<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellabl
     }
 }
 
+/// Compute the OSTree checksum of a file.
 #[cfg(any(feature = "v2017_13", feature = "dox"))]
 pub fn checksum_file_at<P: IsA<gio::Cancellable>>(
     dfd: i32,
index cca5bc88f24ecafbbd2e9e00ec7bc2fa3c66f104..94b41771140f6c5674e8cd888bfcfe58dff13419 100644 (file)
@@ -10,6 +10,7 @@ use std::fmt;
 use std::ptr;
 
 glib::wrapper! {
+    /// Kernel arguments.
     #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
     pub struct KernelArgs(Boxed<ffi::OstreeKernelArgs>);
 
@@ -20,6 +21,7 @@ glib::wrapper! {
 }
 
 impl KernelArgs {
+    /// Add a kernel argument.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn append(&mut self, arg: &str) {
         unsafe {
@@ -27,6 +29,7 @@ impl KernelArgs {
         }
     }
 
+    /// Add multiple kernel arguments.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn append_argv(&mut self, argv: &[&str]) {
         unsafe {
@@ -34,6 +37,7 @@ impl KernelArgs {
         }
     }
 
+    /// Appends each argument that does not have one of `prefixes`.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn append_argv_filtered(&mut self, argv: &[&str], prefixes: &[&str]) {
         unsafe {
@@ -45,6 +49,7 @@ impl KernelArgs {
         }
     }
 
+    /// Append the entire contents of the currently booted kernel commandline.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn append_proc_cmdline<P: IsA<gio::Cancellable>>(
         &mut self,
@@ -65,6 +70,7 @@ impl KernelArgs {
         }
     }
 
+    /// Remove a kernel argument.
     pub fn delete(&mut self, arg: &str) -> Result<(), glib::Error> {
         unsafe {
             let mut error = ptr::null_mut();
@@ -81,6 +87,7 @@ impl KernelArgs {
         }
     }
 
+    /// Remove a kernel argument.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn delete_key_entry(&mut self, key: &str) -> Result<(), glib::Error> {
         unsafe {
@@ -98,6 +105,7 @@ impl KernelArgs {
         }
     }
 
+    /// Given `foo`, return the last the value of a `foo=bar` key as `bar`.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn get_last_value(&self, key: &str) -> Option<GString> {
         unsafe {
@@ -108,6 +116,7 @@ impl KernelArgs {
         }
     }
 
+    /// Replace any existing `foo=bar` with `foo=other` e.g.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn new_replace(&mut self, arg: &str) -> Result<(), glib::Error> {
         unsafe {
@@ -125,6 +134,7 @@ impl KernelArgs {
         }
     }
 
+    /// Append from a whitespace-separated string.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn parse_append(&mut self, options: &str) {
         unsafe {
@@ -135,6 +145,7 @@ impl KernelArgs {
         }
     }
 
+    /// Replace a kernel argument.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn replace(&mut self, arg: &str) {
         unsafe {
@@ -142,6 +153,7 @@ impl KernelArgs {
         }
     }
 
+    /// Replace multiple kernel arguments.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn replace_argv(&mut self, argv: &[&str]) {
         unsafe {
@@ -149,6 +161,7 @@ impl KernelArgs {
         }
     }
 
+    /// A duplicate of `replace`.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn replace_take(&mut self, arg: &str) {
         unsafe {
@@ -156,6 +169,7 @@ impl KernelArgs {
         }
     }
 
+    /// Convert the kernel arguments to a string.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     fn to_gstring(&self) -> GString {
         unsafe {
@@ -165,6 +179,7 @@ impl KernelArgs {
         }
     }
 
+    /// Convert the kernel arguments to a string array.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn to_strv(&self) -> Vec<GString> {
         unsafe {
@@ -177,6 +192,7 @@ impl KernelArgs {
     // Not needed
     //pub fn cleanup(loc: /*Unimplemented*/Option<Fundamental: Pointer>)
 
+    /// Parse the given string as kernel arguments.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn from_string(options: &str) -> KernelArgs {
         unsafe {
@@ -186,6 +202,7 @@ impl KernelArgs {
         }
     }
 
+    /// Create new empty kernel arguments.
     #[cfg(any(feature = "v2019_3", feature = "dox"))]
     pub fn new() -> KernelArgs {
         unsafe { from_glib_full(ffi::ostree_kernel_args_new()) }
index ba5ab14fff640f736c6d87ed2f61948d9b7ebfd0..3f9434ae356fc782b8b1559bd3a018ca8d6a2162 100644 (file)
@@ -92,6 +92,7 @@ impl Repo {
         }
     }
 
+    /// List refs with extended options.
     #[cfg(any(feature = "v2016_4", feature = "dox"))]
     pub fn list_refs_ext<P: IsA<gio::Cancellable>>(
         &self,
index 30ac8cf62ce45390ba3f701e946b6675a156232a..d75691310e5eca63b562ef6e1ecc06921d99bdc5 100644 (file)
@@ -8,20 +8,32 @@ mod repo_checkout_filter;
 #[cfg(any(feature = "v2018_2", feature = "dox"))]
 pub use self::repo_checkout_filter::RepoCheckoutFilter;
 
+/// Options for checking out an OSTree commit.
 pub struct RepoCheckoutAtOptions {
+    /// Checkout mode.
     pub mode: RepoCheckoutMode,
+    /// Overwrite mode.
     pub overwrite_mode: RepoCheckoutOverwriteMode,
+    /// Deprecated, do not use.
     pub enable_uncompressed_cache: bool,
+    /// Perform `fsync()` on checked out files and directories.
     pub enable_fsync: bool,
+    /// Handle OCI/Docker style whiteout files.
     pub process_whiteouts: bool,
+    /// Require hardlinking.
     pub no_copy_fallback: bool,
+    /// Never hardlink; reflink if possible, otherwise full physical copy.
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
     pub force_copy: bool,
+    /// Suppress mode bits outside of 0775 for directories.
     #[cfg(any(feature = "v2017_7", feature = "dox"))]
     pub bareuseronly_dirs: bool,
+    /// Copy zero-sized files rather than hardlinking.
     #[cfg(any(feature = "v2018_9", feature = "dox"))]
     pub force_copy_zerosized: bool,
+    /// Only check out this subpath.
     pub subpath: Option<PathBuf>,
+    /// A cache from device, inode pairs to checksums.
     pub devino_to_csum_cache: Option<RepoDevInoCache>,
     /// A callback function to decide which files and directories will be checked out from the
     /// repo. See the documentation on [RepoCheckoutFilter](struct.RepoCheckoutFilter.html) for more
@@ -34,8 +46,10 @@ pub struct RepoCheckoutAtOptions {
     /// callback to catch and silence any panics that occur.
     #[cfg(any(feature = "v2018_2", feature = "dox"))]
     pub filter: Option<RepoCheckoutFilter>,
+    /// SELinux policy.
     #[cfg(any(feature = "v2017_6", feature = "dox"))]
     pub sepolicy: Option<SePolicy>,
+    /// When computing security contexts, prefix the path with this value.
     pub sepolicy_prefix: Option<String>,
 }
 
index b797cc68aad7919d9b405430aae6da0979b94697..62376f76eba6d214aa71c0704b751fe0c42c9241 100644 (file)
@@ -2,8 +2,11 @@ use ffi::OstreeSysrootDeployTreeOpts;
 use glib::translate::*;
 use libc::c_char;
 
+/// Options for deploying an ostree commit.
 pub struct SysrootDeployTreeOpts<'a> {
+    /// Use these kernel arguments.
     pub override_kernel_argv: Option<&'a [&'a str]>,
+    /// Paths to initramfs files to overlay.
     pub overlay_initrds: Option<&'a [&'a str]>,
 }
 
index 9d2e024b61247ad09042a8d9488536ce421e555f..8c91016027bae1b24f2d4a1fa0ee23af01f82732 100644 (file)
@@ -1,7 +1,9 @@
 use ffi::OstreeSysrootWriteDeploymentsOpts;
 use glib::translate::*;
 
+/// Options for writing a deployment.
 pub struct SysrootWriteDeploymentsOpts {
+    /// Perform cleanup after writing the deployment.
     pub do_postclean: bool,
 }